[IA64] Fix maximum_gpfn hypercall
authorAlex Williamson <alex.williamson@hp.com>
Tue, 5 Feb 2008 16:36:48 +0000 (09:36 -0700)
committerAlex Williamson <alex.williamson@hp.com>
Tue, 5 Feb 2008 16:36:48 +0000 (09:36 -0700)
HVM livemigation fails without this patch.

according to x86 side:
http://xenbits.xensource.com/xen-unstable.hg?rev/55d0a5c70986

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
tools/libxc/ia64/xc_ia64_linux_save.c
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/mm.c

index 007da95d104418bf334e8565196fd5c6f31e11bd..0430a5173a516c837d3b2c317857b055b9250f67 100644 (file)
@@ -485,7 +485,7 @@ xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
         goto out;
     }
 
-    p2m_size = xc_memory_op(xc_handle, XENMEM_maximum_gpfn, &dom);
+    p2m_size = xc_memory_op(xc_handle, XENMEM_maximum_gpfn, &dom) + 1;
 
     /* This is expected by xm restore.  */
     if (write_exact(io_fd, &p2m_size, sizeof(unsigned long))) {
index 9e636638f38b5160c2afb4c6f009c03b7093270e..17375693dd85c27bfdc8a8fed3423f26fea39ccc 100644 (file)
@@ -1768,8 +1768,8 @@ int shadow_mode_control(struct domain *d, xen_domctl_shadow_op_t *sc)
                atomic64_set(&d->arch.shadow_dirty_count, 0);
 
                d->arch.shadow_bitmap_size =
-                       ((d->arch.convmem_end >> PAGE_SHIFT) +
-                        BITS_PER_LONG - 1) & ~(BITS_PER_LONG - 1);
+                       (domain_get_maximum_gpfn(d) + BITS_PER_LONG) &
+                       ~(BITS_PER_LONG - 1);
                d->arch.shadow_bitmap = xmalloc_array(unsigned long,
                                   d->arch.shadow_bitmap_size / BITS_PER_LONG);
                if (d->arch.shadow_bitmap == NULL) {
index 782d12ae975b6d99367f3a0296ba0a1f69ccbe7b..b984ad44c77e1d860a2bcb24543d1e75a42476c9 100644 (file)
@@ -430,7 +430,7 @@ mm_final_teardown(struct domain* d)
 unsigned long
 domain_get_maximum_gpfn(struct domain *d)
 {
-    return (d->arch.convmem_end + PAGE_SIZE - 1) >> PAGE_SHIFT;
+    return (d->arch.convmem_end - 1) >> PAGE_SHIFT;
 }
 
 // stolen from share_xen_page_with_guest() in xen/arch/x86/mm.c